package xyz.zcq.example.consumer;

import xyz.zcq.example.common.model.User;
import xyz.zcq.example.common.service.UserService;
import xyz.zcq.zcqrpc.proxy.ServiceProxyFactory;

/**
 * 简易服务消费者示例
 */
public class EasyConsumerExample {

    public static void main(String[] args) {
//        UserService userService = new UserServiceProxy();
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);

        User user = userService.getUser(new User("zcq"));

        if (user != null) {
            System.out.println(user.getName());
        } else {
            System.out.println("user is null");
        }
    }

}
